//
//  ActivityDetailViewController.m
//  UI_作业03
//
//  Created by dllo on 16/6/7.
//  Copyright © 2016年 zuzhiming. All rights reserved.
//

#import "ActivityDetailViewController.h"
#import "CustomVIew.h"
@interface ActivityDetailViewController ()
/**  活动图像 */
@property (nonatomic, retain) UIImageView *activityIcon;

@property (nonatomic, retain) NSMutableArray *imageArray;

@property (nonatomic, retain) NSArray *textArray;

@end

@implementation ActivityDetailViewController

- (void)dealloc
{
    [_activityIcon release];
    [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    //加载活动标题
    [self createActivityTitle];
    
    //加载活动Icon
    [self createActivityIcon];
    //加载数据
    [self DataHandle];
    
    [self createActivityExplain];
    
    [self createContent];
}

// 活动介绍\n【新专辑2014全国巡演合作咨询】\n@蒋步庭\微博http://weibo.com/jiangbuting\n豆瓣http://www.douban.com/people/jiangjin/\nQQ119365715\n邮箱1193657158@qq.com\n手机18610967776\n【赵雷巡演两千人群241855614】\n【赵雷歌迷背景活动群189347699】\n\n\n-----------------------------------------------------\n\n赵雷2014新专辑<<吉姆餐厅>>专辑首发演出, 北京站\n演出时间:10月19日

//初始化活动标题
- (void)createActivityTitle
{
    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 15, 355, 60)];
    titleLabel.text = @"赵雷2014新专辑 <<吉姆餐厅>> 首发演唱会, 北京站";
    titleLabel.font = [UIFont systemFontOfSize:20.0f];
    titleLabel.numberOfLines = 0;
    [self.view addSubview:titleLabel];
    [titleLabel release];
}

//初始化数据
- (void)DataHandle
{
    self.imageArray = [NSMutableArray array];
    for (NSInteger i = 1; i <= 4; i++) {
        NSString *name = [NSString stringWithFormat:@"%ld.png", i];
        UIImage *image = [UIImage imageNamed:name];
        [self.imageArray addObject:image];
    }
    self.textArray = @[@"10-19 18:00 -- 10-19 23:30", @"赵雷", @"类型: 音乐", @"北京 东城区 北京市东城区和平里西街79号糖果大楼三层"];

}

//初始化活动Icon
- (void)createActivityIcon
{
    self.activityIcon = [[UIImageView alloc] initWithFrame:CGRectMake(10, 80, 120, 180)];
    self.activityIcon.image = [UIImage imageNamed:@"activityIcon"];
    [self.view addSubview:_activityIcon];
    [_activityIcon release];
}

//初始化活动说明
- (void)createActivityExplain
{
    for (NSInteger i = 0; i < self.imageArray.count; i++) {
        CustomVIew *customView = [[CustomVIew alloc] initWithFrame:CGRectMake(140, 83 + i * (30 + 10), 220, 20) LeftImage:self.imageArray[i] LabelText:self.textArray[i]];
        [self.view addSubview:customView];
        [customView release];
    }
    
}

- (void)createContent
{
    UILabel *contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 270, 355, 380)];
    contentLabel.text = @"活动介绍\n\n【新专辑2014全国巡演合作咨询】\n@蒋步庭\n微博http://weibo.com/jiangbuting\n豆瓣http://www.douban.com/people/jiangjin/\nQQ119365715\n邮箱1193657158@qq.com\n手机18610967776\n【赵雷巡演两千人群241855614】\n【赵雷歌迷背景活动群189347699】\n\n----------------------------------------------------------\n\n赵雷2014新专辑<<吉姆餐厅>>专辑首发演出, 北京站\n演出时间:10月19日";
    contentLabel.numberOfLines = 0;
    [self.view addSubview:contentLabel];
    [contentLabel release];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
